s = list(input())
t = input()
n = len(s)-1
while (s[n] == 'z'):
s[n]='a'
n -= 1
s[n] = chr(ord(s[n])+1)
r =''.join(s)
if(r >= t):
print('No such string')
else:
print(r)
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<set>
#include<map>
#include<queue>
#include <iomanip>
#include <bitset>
using namespace std;
#define ll long long
ll gcd(ll a, ll b) { return ((b == 0) ? a : gcd(b, a % b)); }
ll lcm(ll a, ll b) { return (b / gcd(a, b)) * a; }
void hhh() {
// freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
}
void solve() {
string s, t;
cin >> s >> t;
int i = s.size() - 1;
while (i >= 1 && s[i] == 'z') {
s[i--] = 'a';
}
s[i]++;
if (s < t) {
cout << s;
}
else {
cout << "No such string";
}
}
int main() {
hhh();
solve();
return 0;
}
Partitioning binary strings | Special sets |
Smallest chosen word | Going to office |
Color the boxes | Missing numbers |
Maximum sum | 13 Reasons Why |
Friend's Relationship | Health of a person |
Divisibility | A. Movement |
Numbers in a matrix | Sequences |
Split houses | Divisible |
Three primes | Coprimes |
Cost of balloons | One String No Trouble |
Help Jarvis! | Lift queries |
Goki and his breakup | Ali and Helping innocent people |
Book of Potion making | Duration |
Birthday Party | e-maze-in |
Bricks Game | Char Sum |